package com.neuedu.controller; /**
 * 项目：      jweb
 * 类名:       ${NAME}
 * 创建时间：  2023/11/16 14：36
 * 描述 :     ${dc}
 * 作者 :     张金山
 * QQ :     314649444
 * Site:      https://jshand.gitee.io
 */

import com.neuedu.entity.UploadFile;
import com.neuedu.service.UploadFileService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet(name = "FileListServlet", value = "/filelist")
public class FileListServlet extends HttpServlet {
    private UploadFileService service = new UploadFileService();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        List<UploadFile> list = service.list();

        request.setAttribute("list",list);

        request.getRequestDispatcher("/upload/list.jsp").forward(request,response);

    }
}
